﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class KnockerClick : MonoBehaviour,IPointerClickHandler,IPointerEnterHandler,IPointerExitHandler {

    public Texture2D TargetCursor;

    // Use this for initialization
    void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    public void OnPointerClick(PointerEventData eventData)
    {
        GameObject.Find("Axis").GetComponent<EboxRotate>().isOpen = 1;       
    }

    public void OnPointerEnter(PointerEventData eventData)
    {
        //把鼠标指针改为ClickedCursorImg
        TargetCursor = Resources.Load("Cursor/hand1", typeof(Texture2D)) as Texture2D;
        Cursor.SetCursor(TargetCursor, new Vector2(0, 0), CursorMode.Auto);
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        // 重置鼠标指针图标
        Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);       
    }
}
